﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <link href="../CSS/style1.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/style4.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.showModalDialog.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.pager.js" type="text/javascript"></script>
    <script type="text/javascript">
        function date2str(date) {
            //null判断
            if (date == null) return "";
            //去掉左右的斜杠
            date = date.replace(/\//g, "");
            //将其转为一个日期对象
            eval("var d = new " + date + ";");
            //返回最终结果
            return d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate()
        }
        //得到ID
        var ID = window.dialogArguments.id;
        $(function () {
            //通过id将资料从数据库中查询出来
            $.ajax({
                url: "ServiceCreate.asmx/VServiceType",
                type: "post",
                data: JSON.stringify({ id: parseInt(ID) }),
                dataType: "json",
                contentType: "application/json",
                success: function (obj) {

                    $("#Label1").text(obj.d.CusID) || "";
                    $("#Label2").text(obj.d.STName) || "";
                    $("#Label3").text(date2str(obj.d.CSCreateDate)) || "";
                    $("#Label4").text(obj.d.CSCreateName) || "";
                    $("#Label5").text(obj.d.CSTitle) || "";
                    $("#Label6").text(obj.d.CSDesc) || "";
                    
                    if (obj.d.CSDeal == null) {
                        alert("请输入服务处理的内容");
                    } else {
                        $("#text1").val(obj.d.CSDeal);

                        alert("您已处理完毕,处理的服务结果为：" + obj.d.CSDeal);
                    }

                }, error: function (xmlhttp) {
                    alert("错误：" + xmlhttp.responseText);
                }
            });
        });
        //填写服务处理
        function ok() {
            var CSDeal = $("#text1").val();
            //发起更新请求
            var cs = {
                action: "chuli",
                CSID: ID,
                CSDeal: $("#text1").val()
            };
            $.get("CustomServicesWeb.ashx", cs, function (r) {
                if (r == "1") {
                    alert("服务处理成功!您下一步需要进行服务反馈");
                    window.returnValue = true;
                    window.close();
                } else {
                    alert("服务处理失败");
                }
            });
            

        };

    </script>
</head>

<body>
    <table class="tableEdit" id="tab" style="width:500px;">
        <thead>
            <tr>
                <td colspan="4">服务信息</td>
            </tr>
        </thead>
        <tr>
            <th>客户编号：</th>
            <td>
               <label id="Label1">HK201111110001</label>
            </td>
            <th>服务类型：</th>
            <td>
                <label id="Label2">投诉</label>
            </td>
        </tr>
        <tr>
            <th>创建时候：</th>
            <td><label id="Label3">2011-5-2</label>
               </td>
            <th>创建人：</th>
            <td>
                <label id="Label4">张三</label>
            </td>
        </tr>
        <tr>
            <th>服务概要：</th>
            <td colspan="3">
               <label id="Label5"><!--质量问题--></label>
             </td>
        </tr>
        <tr>
            <th>详细信息：</th>
            <td colspan="3">
                <label id="Label6"><!--购买的商品出现质量问题--></label>
             </td>
        </tr>
    </table>
    <table class="tableEdit" id="tb2" style="width:500px;">
        <thead>
            <tr>
                <td colspan="4">服务处理</td>
            </tr>
        </thead>
        <tr>
            <th>服务处理：</th>
            <td colspan="3">
               <textarea  id="text1"></textarea>
             </td>
        </tr>
         <tfoot>
            <tr>
                <td colspan="4">
                     <input type="button" value="确定" onclick="ok();" />&nbsp;&nbsp;
                     <input type="button" value="关闭" onclick="window.close()" />
                </td>
            </tr>
        </tfoot>
    </table>
</body>
</html>
